<template>
	<view class="selecTemplateOffice" :class="APPTheme" style="margin: 0;padding: 0;">
		<!-- <uni-nav-bar fixed status-bar title="协作文档" left-icon="back" :color="APPTheme=='theme-light'?'#000000':'#ffffff'" :background-color="APPTheme=='theme-light'?'#ffffff':'#000000'" @clickLeft="navigatoBack"></uni-nav-bar> -->
		<web-view :src="webViewURL" v-if="webViewURL" @message="messageFn"></web-view>
	</view>
</template>

<script>
	let that
	import {
		mapGetters,
		mapActions
	} from 'vuex'
	export default {
		components:{
		},
		data() {
			return {
				wps:{
					wpsUrl:'',
					token:''
				},
				webViewURL:'',
				sever_Wps:false,//是否保存
			}
		},
		computed: {
			...mapGetters(['APPTheme', 'userInfo', 'api']),
		},
		onLoad(e) {
			that = this
			console.log('接收到',e);
			that.wps={
				wpsUrl:e.wpsUrl,
				token:e.token,
			}
			that.webViewURL=`/hybrid/html/pages/wps.html?wpsUrl=${encodeURIComponent(that.wps.wpsUrl)}&token=${that.wps.token}`
		},
		onShow() {
			//设置导航条颜色
			// setTimeout(function(){
			// 	that.GLOBAL.lznavigate.lzSetNavigationBarColor(that.APPTheme)
			// },500)
		},
		//监听页面返回
		onBackPress(){
			if(this.sever_Wps){
				uni.$emit('sever_Wps',true)
			}
			
		},
		methods: {
			navigatoBack(){
				uni.navigateBack({delta: 1});
			},
			//文件保存成功
			messageFn(event){
				that.sever_Wps=true
			}
		},
		
	};
</script>

<style scoped lang="scss">
</style>
